package com.zmn.plat.manager.dictionary;

import com.google.common.collect.Lists;
import com.zmn.common.dictionary.DictModel;
import org.hibernate.validator.constraints.Range;

import java.util.List;

/**
 * 类描述：订单投诉配置字典
 *
 * @author mujunlin
 * @since 2020/03/05 4:27 下午
 */
public class OrderComplainDict {

    /**
     * 投诉类型：其他
     */
    public final static int COMPLAIN_TYPE_OTHER = 1;

    /**
     * 投诉类型：价格
     */
    public final static int COMPLAIN_TYPE_PRICE = 2;

    /**
     * 投诉类型：服务态度
     */
    public final static int COMPLAIN_TYPE_ATTITUDE = 3;

    /**
     * 投诉类型：技术不专业
     */
    public final static int COMPLAIN_TYPE_TECH = 4;

    /**
     * 投诉类型：我要催单
     */
    public final static int COMPLAIN_TYPE_URGE = 5;

    /**
     * 投诉类型：咨询
     */
    public final static int COMPLAIN_TYPE_CONSULT = 6;




    /**
     * 获取投诉类型列表
     *
     * @return 投诉类型字典列表
     */
    public static List<DictModel> listOrderComplainType() {
        List<DictModel> items = Lists.newArrayList();
        items.add(new DictModel(COMPLAIN_TYPE_PRICE, "价格"));
        items.add(new DictModel(COMPLAIN_TYPE_ATTITUDE, "服务态度"));
        items.add(new DictModel(COMPLAIN_TYPE_TECH, "技术不专业"));
        items.add(new DictModel(COMPLAIN_TYPE_URGE, "我要催单"));
        items.add(new DictModel(COMPLAIN_TYPE_CONSULT, "咨询"));
        return items;
    }

    /**
     * 根据投诉类型ID查询类型名称
     *
     * @param typeId 投诉类型ID
     * @return 投诉类型名称
     */
    public static String getOrderComplainTypeById(@Range(min = 1, max = 5) Integer typeId) {

        switch (typeId) {
            case COMPLAIN_TYPE_PRICE:
                return "价格";
            case COMPLAIN_TYPE_ATTITUDE:
                return "服务态度";
            case COMPLAIN_TYPE_TECH:
                return "技术不专业";
            case COMPLAIN_TYPE_URGE:
                return "我要催单";
            case COMPLAIN_TYPE_OTHER:
                return "其他";
            default:
                return "ID错误";
        }
    }


}
